#include "lolevel.h"
#include "platform.h"
#include "core.h"
#include "conf.h"

static long *nrflag = (long*)0x5BA0;

#include "../../../generic/capt_seq.c"

void __attribute__((naked,noinline)) capt_seq_task() {
 asm volatile (
                 "STMFD   SP!, {R3-R7,LR}\n"
                 "LDR     R6, =0x26DC\n"
 "loc_FFC42F3C:\n"
                 "LDR     R0, [R6,#4]\n"
                 "MOV     R2, #0\n"
                 "MOV     R1, SP\n"
                 "BL      sub_FFC15EBC\n"
                 "TST     R0, #1\n"
                 "BEQ     loc_FFC42F68\n"
                 "LDR     R1, =0x588\n"
                 "LDR     R0, =0xFFC42B3C\n"
                 "BL      sub_FFC0BE9C\n"
                 "BL      sub_FFC0BC54\n"
                 "LDMFD   SP!, {R3-R7,PC}\n"
 "loc_FFC42F68:\n"
                 "LDR     R0, [SP]\n"
                 "LDR     R1, [R0]\n"
                 "CMP     R1, #0x1D\n"
                 "ADDLS   PC, PC, R1,LSL#2\n"
                 "B       loc_FFC43154\n"
 "loc_FFC42F7C:\n"
                 "B       loc_FFC42FF4\n"
 "loc_FFC42F80:\n"
                 "B       loc_FFC42FFC\n"
 "loc_FFC42F84:\n"
                 "B       loc_FFC43024\n"
 "loc_FFC42F88:\n"
                 "B       loc_FFC43038\n"
 "loc_FFC42F8C:\n"
                 "B       loc_FFC43030\n"
 "loc_FFC42F90:\n"
                 "B       loc_FFC43040\n"
 "loc_FFC42F94:\n"
                 "B       loc_FFC43048\n"
 "loc_FFC42F98:\n"
                 "B       loc_FFC43054\n"
 "loc_FFC42F9C:\n"
                 "B       loc_FFC430AC\n"
 "loc_FFC42FA0:\n"
                 "B       loc_FFC43038\n"
 "loc_FFC42FA4:\n"
                 "B       loc_FFC430B4\n"
 "loc_FFC42FA8:\n"
                 "B       loc_FFC430C4\n"
 "loc_FFC42FAC:\n"
                 "B       loc_FFC430CC\n"
 "loc_FFC42FB0:\n"
                 "B       loc_FFC430D4\n"
 "loc_FFC42FB4:\n"
                 "B       loc_FFC430DC\n"
 "loc_FFC42FB8:\n"
                 "B       loc_FFC430E4\n"
 "loc_FFC42FBC:\n"
                 "B       loc_FFC430EC\n"
 "loc_FFC42FC0:\n"
                 "B       loc_FFC430F4\n"
 "loc_FFC42FC4:\n"
                 "B       loc_FFC43100\n"
 "loc_FFC42FC8:\n"
                 "B       loc_FFC43108\n"
 "loc_FFC42FCC:\n"
                 "B       loc_FFC43110\n"
 "loc_FFC42FD0:\n"
                 "B       loc_FFC43118\n"
 "loc_FFC42FD4:\n"
                 "B       loc_FFC43120\n"
 "loc_FFC42FD8:\n"
                 "B       loc_FFC4312C\n"
 "loc_FFC42FDC:\n"
                 "B       loc_FFC43134\n"
 "loc_FFC42FE0:\n"
                 "B       loc_FFC4313C\n"
 "loc_FFC42FE4:\n"
                 "B       loc_FFC43144\n"
 "loc_FFC42FE8:\n"
                 "B       loc_FFC4314C\n"
 "loc_FFC42FEC:\n"
                 "B       loc_FFC43160\n"
 "loc_FFC42FF0:\n"
                 "B       loc_FFC43160\n"
 "loc_FFC42FF4:\n"
                 "BL      sub_FFC437C0\n"
                 "BL      shooting_expo_param_override\n"      // +
                 "B       loc_FFC4304C\n"
 "loc_FFC42FFC:\n"
                 "MOV     R0, #0xC\n"
                 "BL      sub_FFC46E34\n"
                 "TST     R0, #1\n"
                 "LDR     R0, [SP]\n"
                 "MOVNE   R1, #1\n"
                 "LDRNE   R2, [R0,#0xC]\n"
                 "MOVNE   R0, #1\n"
                 "BNE     loc_FFC430A4\n"
                 "BL      sub_FFC4327C_my\n"  //--------->
                 "B       loc_FFC43160\n"
 "loc_FFC43024:\n"
                 "MOV     R0, #1\n"
                 "BL      sub_FFC4395C\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43030:\n"
                 "BL      sub_FFC43448\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43038:\n"
                 "BL      sub_FFC437A0\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43040:\n"
                 "BL      sub_FFC437A8\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43048:\n"
                 "BL      sub_FFC4387C\n"
 "loc_FFC4304C:\n"
                 "BL      sub_FFC411F8\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43054:\n"
                 "LDR     R4, [R0,#0xC]\n"
                 "BL      sub_FFC437B0\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FFCE88BC\n"
                 "TST     R0, #1\n"
                 "MOV     R5, R0\n"
                 "BNE     loc_FFC43094\n"
                 "BL      sub_FFC51AD4\n"
                 "STR     R0, [R4,#0x18]\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FFCE972C\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FFCE9B80\n"
                 "MOV     R5, R0\n"
                 "LDR     R0, [R4,#0x18]\n"
                 "BL      sub_FFC51CE8\n"
 "loc_FFC43094:\n"
                 "BL      sub_FFC437A0\n"
                 "MOV     R2, R4\n"
                 "MOV     R1, #9\n"
                 "MOV     R0, R5\n"
 "loc_FFC430A4:\n"
                 "BL      sub_FFC41628\n"
                 "B       loc_FFC43160\n"
 "loc_FFC430AC:\n"
                 "BL      sub_FFC438DC\n"
                 "B       loc_FFC4304C\n"
 "loc_FFC430B4:\n"
                 "LDR     R0, =0x12A48\n"
                 "LDR     R0, [R0,#0x4C]\n"
                 "BL      sub_FFC43C70\n"
                 "B       loc_FFC43160\n"
 "loc_FFC430C4:\n"
                 "BL      sub_FFC43F18\n"
                 "B       loc_FFC43160\n"
 "loc_FFC430CC:\n"
                 "BL      sub_FFC43FAC\n"
                 "B       loc_FFC43160\n"
 "loc_FFC430D4:\n"
                 "BL      sub_FFCE8AD8\n"
                 "B       loc_FFC43160\n"
 "loc_FFC430DC:\n"
                 "BL      sub_FFCE8CC0\n"
                 "B       loc_FFC43160\n"
 "loc_FFC430E4:\n"
                 "BL      sub_FFCE8D50\n"
                 "B       loc_FFC43160\n"
 "loc_FFC430EC:\n"
                 "BL      sub_FFCE8DF8\n"
                 "B       loc_FFC43160\n"
 "loc_FFC430F4:\n"
                 "MOV     R0, #0\n"
                 "BL      sub_FFCE8FB4\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43100:\n"
                 "BL      sub_FFCE90F4\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43108:\n"
                 "BL      sub_FFCE9188\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43110:\n"
                 "BL      sub_FFCE924C\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43118:\n"
                 "BL      sub_FFC43AC4\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43120:\n"
                 "BL      sub_FFC43AF0\n"
                 "BL      sub_FFC13F74\n"
                 "B       loc_FFC43160\n"
 "loc_FFC4312C:\n"
                 "BL      sub_FFCE8EB4\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43134:\n"
                 "BL      sub_FFCE8EF8\n"
                 "B       loc_FFC43160\n"
 "loc_FFC4313C:\n"
                 "BL      sub_FFC45A70\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43144:\n"
                 "BL      sub_FFC45A8C\n"
                 "B       loc_FFC43160\n"
 "loc_FFC4314C:\n"
                 "BL      sub_FFC45A9C\n"
                 "B       loc_FFC43160\n"
 "loc_FFC43154:\n"
                 "LDR     R1, =0x6C9\n"
                 "LDR     R0, =0xFFC42B3C\n"
                 "BL      sub_FFC0BE9C\n"
 "loc_FFC43160:\n"
                 "LDR     R0, [SP]\n"
                 "LDR     R1, [R0,#4]\n"
                 "LDR     R0, [R6]\n"
                 "BL      sub_FFC15C2C\n"
                 "LDR     R4, [SP]\n"
                 "LDR     R0, [R4,#8]\n"
                 "CMP     R0, #0\n"
                 "LDREQ   R1, =0x12B\n"
                 "LDREQ   R0, =0xFFC42B3C\n"
                 "BLEQ    sub_FFC0BE9C\n"
                 "MOV     R0, #0\n"
                 "STR     R0, [R4,#8]\n"
                 "B       loc_FFC42F3C\n"
 );
} 



void __attribute__((naked,noinline)) sub_FFC4327C_my(){ // 
 asm volatile(
                 "STMFD   SP!, {R3-R5,LR}\n"
                 "LDR     R4, [R0,#0xC]\n"
                 "LDR     R0, [R4,#8]\n"
                 "ORR     R0, R0, #1\n"
                 "STR     R0, [R4,#8]\n"
                 "BL      sub_FFC437B0\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FFC43A78\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FFCE854C\n"
                 "CMP     R0, #0\n"
                 "MOV     R0, R4\n"
                 "BEQ     loc_FFC432CC\n"
                 "BL      sub_FFCE85E8\n"
                 "TST     R0, #1\n"
                 "MOVNE   R2, R4\n"
                 "LDMNEFD SP!, {R3-R5,LR}\n"
                 "MOVNE   R1, #1\n"
                 "BNE     sub_FFC41628\n"
                 "B       loc_FFC432D0\n"
 "loc_FFC432CC:\n"
                 "BL      sub_FFCE859C\n"
 "loc_FFC432D0:\n"
                 "MOV     R0, #0\n"
                 "STR     R0, [SP]\n"
                 "LDR     R0, =0x12A48\n"
                 "MOV     R2, #2\n"
                 "LDRH    R0, [R0,#0x8E]\n"
                 "MOV     R1, SP\n"
                 "CMP     R0, #3\n"
                 "LDRNE   R0, [R4,#0xC]\n"
                 "CMPNE   R0, #1\n"
                 "MOVHI   R0, #1\n"
                 "STRHI   R0, [SP]\n"
                 "LDR     R0, =0x123\n"
                 "BL      sub_FFC5183C\n"
                 "BL      sub_FFC51AD4\n"
                 "STR     R0, [R4,#0x18]\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FFCE972C\n"
                 "BL      sub_FFCEA1F4\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FFCE97F4_my\n"             //---------->
                 "MOV     R5, R0\n"
                 "BL      capt_seq_hook_raw_here\n"      // +
                 "BL      sub_FFC45A8C\n"
                 "BL      sub_FFC45AC8\n"
                 "MOV     R2, R4\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, R5\n"
                 "BL      sub_FFC41628\n"
                 "BL      sub_FFCE9B24\n"
                 "CMP     R0, #0\n"
                 "LDRNE   R0, [R4,#8]\n"
                 "ORRNE   R0, R0, #0x2000\n"
                 "STRNE   R0, [R4,#8]\n"
                 "LDMFD   SP!, {R3-R5,PC}\n"
 );
}



void __attribute__((naked,noinline)) sub_FFCE97F4_my(){ // 
 asm volatile(
                 "STMFD   SP!, {R0-R8,LR}\n"
                 "MOV     R4, R0\n"
                 "BL      sub_FFCEA360\n"
                 "MVN     R1, #0\n"
                 "BL      sub_FFC15C60\n"
                 "LDR     R5, =0x5BA0\n"
                 "LDR     R0, [R5,#0xC]\n"
                 "CMP     R0, #0\n"
                 "BNE     loc_FFCE9844\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #0\n"
                 "BL      sub_FFC0BCD0\n"
                 "STR     R0, [R5,#0xC]\n"
                 "MOV     R3, #0\n"
                 "STR     R3, [SP]\n"
                 "LDR     R3, =0xFFCE9340\n"
                 "LDR     R0, =0xFFCE9AEC\n"
                 "MOV     R2, #0x400\n"
                 "MOV     R1, #0x17\n"
                 "BL      sub_FFC0BC9C\n"
 "loc_FFCE9844:\n"
                 "MOV     R2, #4\n"
                 "ADD     R1, SP, #8\n"
                 "MOV     R0, #0x8A\n"
                 "BL      sub_FFC51944\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0x3A7\n"
                 "LDRNE   R0, =0xFFCE956C\n"
                 "BLNE    sub_FFC0BE9C\n"
                 "LDR     R8, =0x12B04\n"
                 "LDR     R7, =0x12A48\n"
                 "LDRSH   R1, [R8,#0xE]\n"
                 "LDR     R0, [R7,#0x84]\n"
            //   "BL      nullsub_27\n"
                 "BL      sub_FFC2E8F0\n"
                 "LDR     R3, =0x5BA8\n"
                 "STRH    R0, [R4,#0x9C]\n"
                 "SUB     R2, R3, #4\n"
                 "STRD    R2, [SP]\n"
                 "MOV     R1, R0\n"
                 "LDRH    R0, [R7,#0x54]\n"
                 "LDRSH   R2, [R8,#0xC]\n"
                 "SUB     R3, R3, #8\n"
                 "BL      sub_FFCEA944\n"                            
                 "BL      wait_until_remote_button_is_released\n"     // +
                 "BL      capt_seq_hook_set_nr\n"                     // +
                 "B       sub_FFCE98A0\n"                             // continue function in firmware
 );
}


/*************************************************************/
void __attribute__((naked,noinline)) exp_drv_task(){
 asm volatile(
/*                 "STMFD   SP!, {R4-R8,LR}\n"
                 "SUB     SP, SP, #0x20\n"
                 "LDR     R8, =0xBB8\n"
                 "LDR     R7, =0x6EE4\n"
                 "LDR     R5, =0x210F0\n"
                 "MOV     R0, #0\n"
                 "ADD     R6, SP, #0x10\n"
                 "STR     R0, [SP,#0xC]\n"
 "loc_FF8AD7EC:\n"
                 "LDR     R0, [R7,#0x20]\n"
                 "MOV     R2, #0\n"
                 "ADD     R1, SP, #0x1C\n"
                 "BL      sub_FF8274FC\n"
                 "LDR     R0, [SP,#0xC]\n"
                 "CMP     R0, #1\n"
                 "BNE     loc_FF8AD834\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R0, [R0]\n"
                 "CMP     R0, #0x13\n"
                 "CMPNE   R0, #0x14\n"
                 "CMPNE   R0, #0x15\n"
                 "BEQ     loc_FF8AD950\n"
                 "CMP     R0, #0x27\n"
                 "BEQ     loc_FF8AD928\n"
                 "ADD     R1, SP, #0xC\n"
                 "MOV     R0, #0\n"
                 "BL      sub_FF8AD740\n"
 "loc_FF8AD834:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0]\n"
                 "CMP     R1, #0x2C\n"
                 "BNE     loc_FF8AD864\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "BL      sub_FF8AEA1C\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R1, #1\n"
                 "BL      sub_FF871404\n"
                 "BL      sub_FF81B184\n"
                 "ADD     SP, SP, #0x20\n"
                 "LDMFD   SP!, {R4-R8,PC}\n"
 "loc_FF8AD864:\n"
                 "CMP     R1, #0x2B\n"
                 "BNE     loc_FF8AD880\n"
                 "LDR     R2, [R0,#0x88]!\n"
                 "LDR     R1, [R0,#4]\n"
                 "MOV     R0, R1\n"
                 "BLX     R2\n"
                 "B       loc_FF8ADD70\n"
 "loc_FF8AD880:\n"
                 "CMP     R1, #0x25\n"
                 "BNE     loc_FF8AD8D0\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R1, #0x80\n"
                 "BL      sub_FF871438\n"
                 "LDR     R0, =0xFF8AA204\n"
                 "MOV     R1, #0x80\n"
                 "BL      sub_FF93B058\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R2, R8\n"
                 "MOV     R1, #0x80\n"
                 "BL      sub_FF871344\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0xD36\n"
                 "BNE     loc_FF8AD914\n"
 "loc_FF8AD8BC:\n"
                 "LDR     R1, [SP,#0x1C]\n"
                 "LDR     R0, [R1,#0x8C]\n"
                 "LDR     R1, [R1,#0x88]\n"
                 "BLX     R1\n"
                 "B       loc_FF8ADD70\n"
 "loc_FF8AD8D0:\n"
                 "CMP     R1, #0x26\n"
                 "BNE     loc_FF8AD920\n"
                 "ADD     R1, SP, #0xC\n"
                 "BL      sub_FF8AD740\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R1, #0x100\n"
                 "BL      sub_FF871438\n"
                 "LDR     R0, =0xFF8AA214\n"
                 "MOV     R1, #0x100\n"
                 "BL      sub_FF93B9E4\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R2, R8\n"
                 "MOV     R1, #0x100\n"
                 "BL      sub_FF871344\n"
                 "TST     R0, #1\n"
                 "BEQ     loc_FF8AD8BC\n"
                 "MOV     R1, #0xD40\n"
 "loc_FF8AD914:\n"
                 "LDR     R0, =0xFF8AA90C\n"
                 "BL      sub_FF81B1CC\n"
                 "B       loc_FF8AD8BC\n"
 "loc_FF8AD920:\n"
                 "CMP     R1, #0x27\n"
                 "BNE     loc_FF8AD938\n"
 "loc_FF8AD928:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "ADD     R1, SP, #0xC\n"
                 "BL      sub_FF8AD740\n"
                 "B       loc_FF8AD8BC\n"
 "loc_FF8AD938:\n"
                 "CMP     R1, #0x2A\n"
                 "BNE     loc_FF8AD950\n"
                 "BL      sub_FF89D33C\n"
                 "BL      sub_FF89DFC8\n"
                 "BL      sub_FF89DB00\n"
                 "B       loc_FF8AD8BC\n"
 "loc_FF8AD950:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "MOV     R4, #1\n"
                 "LDR     R1, [R0]\n"
                 "CMP     R1, #0x11\n"
                 "CMPNE   R1, #0x12\n"
                 "BNE     loc_FF8AD9C0\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "ADD     R1, R1, R1,LSL#1\n"
                 "ADD     R1, R0, R1,LSL#2\n"
                 "SUB     R1, R1, #8\n"
                 "LDMIA   R1, {R2-R4}\n"
                 "STMIA   R6, {R2-R4}\n"
                 "BL      sub_FF8AC2B4\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R3, [R0,#0x88]\n"
                 "LDR     R2, [R0,#0x8C]\n"
                 "ADD     R0, R0, #4\n"
                 "BLX     R3\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "BL      sub_FF8AEDD0\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R3, [R0,#0x90]\n"
                 "LDR     R2, [R0,#0x94]\n"
                 "ADD     R0, R0, #4\n"
                 "BLX     R3\n"
                 "B       loc_FF8ADCB0\n"
 "loc_FF8AD9C0:\n"
                 "CMP     R1, #0x13\n"
                 "CMPNE   R1, #0x14\n"
                 "CMPNE   R1, #0x15\n"
                 "BNE     loc_FF8ADA74\n"
                 "ADD     R3, SP, #0xC\n"
                 "MOV     R2, SP\n"
                 "ADD     R1, SP, #0x10\n"
                 "BL      sub_FF8AC4FC\n"
                 "CMP     R0, #1\n"
                 "MOV     R4, R0\n"
                 "CMPNE   R4, #5\n"
                 "BNE     loc_FF8ADA10\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "MOV     R2, R4\n"
                 "LDR     R1, [R0,#0x7C]!\n"
                 "LDR     R12, [R0,#0xC]!\n"
                 "LDR     R3, [R0,#4]\n"
                 "MOV     R0, SP\n"
                 "BLX     R12\n"
                 "B       loc_FF8ADA48\n"
 "loc_FF8ADA10:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "CMP     R4, #2\n"
                 "LDR     R3, [R0,#0x8C]\n"
                 "CMPNE   R4, #6\n"
                 "BNE     loc_FF8ADA5C\n"
                 "LDR     R12, [R0,#0x88]\n"
                 "MOV     R0, SP\n"
                 "MOV     R2, R4\n"
                 "MOV     R1, #1\n"
                 "BLX     R12\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "MOV     R2, SP\n"
                 "ADD     R1, SP, #0x10\n"
                 "BL      sub_FF8AD48C\n"
 "loc_FF8ADA48:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R2, [SP,#0xC]\n"
                 "MOV     R1, R4\n"
                 "BL      sub_FF8AD6E0\n"
                 "B       loc_FF8ADCB0\n"
 "loc_FF8ADA5C:\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R12, [R0,#0x88]\n"
                 "ADD     R0, R0, #4\n"
                 "MOV     R2, R4\n"
                 "BLX     R12\n"
                 "B       loc_FF8ADCB0\n"
 "loc_FF8ADA74:\n"
                 "CMP     R1, #0x21\n"
                 "CMPNE   R1, #0x22\n"
                 "BNE     loc_FF8ADAC0\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "ADD     R1, R1, R1,LSL#1\n"
                 "ADD     R1, R0, R1,LSL#2\n"
                 "SUB     R1, R1, #8\n"
                 "LDMIA   R1, {R2-R4}\n"
                 "STMIA   R6, {R2-R4}\n"
                 "BL      sub_FF8AB834\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R3, [R0,#0x88]\n"
                 "LDR     R2, [R0,#0x8C]\n"
                 "ADD     R0, R0, #4\n"
                 "BLX     R3\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "BL      sub_FF8ABB30\n"
                 "B       loc_FF8ADCB0\n"
 "loc_FF8ADAC0:\n"
                 "ADD     R1, R0, #4\n"
                 "LDMIA   R1, {R2,R3,R12}\n"
                 "STMIA   R6, {R2,R3,R12}\n"
                 "LDR     R1, [R0]\n"
                 "CMP     R1, #0x24\n"
                 "ADDLS   PC, PC, R1,LSL#2\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADADC:\n"
                 "B       loc_FF8ADB70\n"
 "loc_FF8ADAE0:\n"
                 "B       loc_FF8ADB70\n"
 "loc_FF8ADAE4:\n"
                 "B       loc_FF8ADB78\n"
 "loc_FF8ADAE8:\n"
                 "B       loc_FF8ADB80\n"
 "loc_FF8ADAEC:\n"
                 "B       loc_FF8ADB80\n"
 "loc_FF8ADAF0:\n"
                 "B       loc_FF8ADB80\n"
 "loc_FF8ADAF4:\n"
                 "B       loc_FF8ADB70\n"
 "loc_FF8ADAF8:\n"
                 "B       loc_FF8ADB78\n"
 "loc_FF8ADAFC:\n"
                 "B       loc_FF8ADB80\n"
 "loc_FF8ADB00:\n"
                 "B       loc_FF8ADB80\n"
 "loc_FF8ADB04:\n"
                 "B       loc_FF8ADB98\n"
 "loc_FF8ADB08:\n"
                 "B       loc_FF8ADB98\n"
 "loc_FF8ADB0C:\n"
                 "B       loc_FF8ADC84\n"
 "loc_FF8ADB10:\n"
                 "B       loc_FF8ADC8C\n"
 "loc_FF8ADB14:\n"
                 "B       loc_FF8ADC8C\n"
 "loc_FF8ADB18:\n"
                 "B       loc_FF8ADC8C\n"
 "loc_FF8ADB1C:\n"
                 "B       loc_FF8ADC8C\n"
 "loc_FF8ADB20:\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB24:\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB28:\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB2C:\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB30:\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB34:\n"
                 "B       loc_FF8ADB88\n"
 "loc_FF8ADB38:\n"
                 "B       loc_FF8ADB90\n"
 "loc_FF8ADB3C:\n"
                 "B       loc_FF8ADB90\n"
 "loc_FF8ADB40:\n"
                 "B       loc_FF8ADBA4\n"
 "loc_FF8ADB44:\n"
                 "B       loc_FF8ADBA4\n"
 "loc_FF8ADB48:\n"
                 "B       loc_FF8ADBAC\n"
 "loc_FF8ADB4C:\n"
                 "B       loc_FF8ADBDC\n"
 "loc_FF8ADB50:\n"
                 "B       loc_FF8ADC0C\n"
 "loc_FF8ADB54:\n"
                 "B       loc_FF8ADC3C\n"
 "loc_FF8ADB58:\n"
                 "B       loc_FF8ADC6C\n"
 "loc_FF8ADB5C:\n"
                 "B       loc_FF8ADC6C\n"
 "loc_FF8ADB60:\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB64:\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB68:\n"
                 "B       loc_FF8ADC74\n"
 "loc_FF8ADB6C:\n"
                 "B       loc_FF8ADC7C\n"
 "loc_FF8ADB70:\n"
                 "BL      sub_FF8AA6F8\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB78:\n"
                 "BL      sub_FF8AA980\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB80:\n"
                 "BL      sub_FF8AAB84\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB88:\n"
                 "BL      sub_FF8AADEC\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB90:\n"
                 "BL      sub_FF8AAFE0\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADB98:\n"
                 "BL      sub_FF8AB248_my\n"  //------------>
                 "MOV     R4, #0\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADBA4:\n"
                 "BL      sub_FF8AB384\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADBAC:\n"
                 "LDRH    R1, [R0,#4]\n"
                 "STRH    R1, [SP,#0x10]\n"
                 "LDRH    R1, [R5,#2]\n"
                 "STRH    R1, [SP,#0x12]\n"
                 "LDRH    R1, [R5,#4]\n"
                 "STRH    R1, [SP,#0x14]\n"
                 "LDRH    R1, [R5,#6]\n"
                 "STRH    R1, [SP,#0x16]\n"
                 "LDRH    R1, [R0,#0xC]\n"
                 "STRH    R1, [SP,#0x18]\n"
                 "BL      sub_FF8AEA90\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADBDC:\n"
                 "LDRH    R1, [R0,#4]\n"
                 "STRH    R1, [SP,#0x10]\n"
                 "LDRH    R1, [R5,#2]\n"
                 "STRH    R1, [SP,#0x12]\n"
                 "LDRH    R1, [R5,#4]\n"
                 "STRH    R1, [SP,#0x14]\n"
                 "LDRH    R1, [R5,#6]\n"
                 "STRH    R1, [SP,#0x16]\n"
                 "LDRH    R1, [R5,#8]\n"
                 "STRH    R1, [SP,#0x18]\n"
                 "BL      sub_FF8AEBEC\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADC0C:\n"
                 "LDRH    R1, [R5]\n"
                 "STRH    R1, [SP,#0x10]\n"
                 "LDRH    R1, [R0,#6]\n"
                 "STRH    R1, [SP,#0x12]\n"
                 "LDRH    R1, [R5,#4]\n"
                 "STRH    R1, [SP,#0x14]\n"
                 "LDRH    R1, [R5,#6]\n"
                 "STRH    R1, [SP,#0x16]\n"
                 "LDRH    R1, [R5,#8]\n"
                 "STRH    R1, [SP,#0x18]\n"
                 "BL      sub_FF8AEC98\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADC3C:\n"
                 "LDRH    R1, [R5]\n"
                 "STRH    R1, [SP,#0x10]\n"
                 "LDRH    R1, [R5,#2]\n"
                 "STRH    R1, [SP,#0x12]\n"
                 "LDRH    R1, [R5,#4]\n"
                 "STRH    R1, [SP,#0x14]\n"
                 "LDRH    R1, [R5,#6]\n"
                 "STRH    R1, [SP,#0x16]\n"
                 "LDRH    R1, [R0,#0xC]\n"
                 "STRH    R1, [SP,#0x18]\n"
                 "BL      sub_FF8AED38\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADC6C:\n"
                 "BL      sub_FF8AB5F8\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADC74:\n"
                 "BL      sub_FF8ABC34\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADC7C:\n"
                 "BL      sub_FF8ABE6C\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADC84:\n"
                 "BL      sub_FF8ABFE4\n"
                 "B       loc_FF8ADC90\n"
 "loc_FF8ADC8C:\n"
                 "BL      sub_FF8AC17C\n"
 "loc_FF8ADC90:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R3, [R0,#0x88]\n"
                 "LDR     R2, [R0,#0x8C]\n"
                 "ADD     R0, R0, #4\n"
                 "BLX     R3\n"
                 "CMP     R4, #1\n"
                 "BNE     loc_FF8ADCF8\n"
 "loc_FF8ADCB0:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "MOV     R2, #0xC\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "ADD     R1, R1, R1,LSL#1\n"
                 "ADD     R0, R0, R1,LSL#2\n"
                 "SUB     R4, R0, #8\n"
                 "LDR     R0, =0x210F0\n"
                 "ADD     R1, SP, #0x10\n"
                 "BL      sub_FFB00004\n"
                 "LDR     R0, =0x210FC\n"
                 "MOV     R2, #0xC\n"
                 "ADD     R1, SP, #0x10\n"
                 "BL      sub_FFB00004\n"
                 "LDR     R0, =0x21108\n"
                 "MOV     R2, #0xC\n"
                 "MOV     R1, R4\n"
                 "BL      sub_FFB00004\n"
                 "B       loc_FF8ADD70\n"
 "loc_FF8ADCF8:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R0, [R0]\n"
                 "CMP     R0, #0xB\n"
                 "BNE     loc_FF8ADD40\n"
                 "MOV     R3, #0\n"
                 "STR     R3, [SP]\n"
                 "MOV     R3, #1\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #0\n"
                 "BL      sub_FF8AA500\n"
                 "MOV     R3, #0\n"
                 "STR     R3, [SP]\n"
                 "MOV     R3, #1\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #0\n"
                 "B       loc_FF8ADD6C\n"
 "loc_FF8ADD40:\n"
                 "MOV     R3, #1\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #1\n"
                 "STR     R3, [SP]\n"
                 "BL      sub_FF8AA500\n"
                 "MOV     R3, #1\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #1\n"
                 "STR     R3, [SP]\n"
 "loc_FF8ADD6C:\n"
                 "BL      sub_FF8AA640\n"
 "loc_FF8ADD70:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "BL      sub_FF8AEA1C\n"
                 "B       loc_FF8AD7EC\n"*/

                 "STMFD   SP!, {R4-R8,LR}\n"
                 "SUB     SP, SP, #0x20\n"
                 "LDR     R8, =0xBB8\n"
                 "LDR     R7, =0x36EC\n"
                 "LDR     R5, =0x17550\n"
                 "MOV     R0, #0\n"
                 "ADD     R6, SP, #0x10\n"
                 "STR     R0, [SP,#0xC]\n"
 "loc_FFC74CD0:\n"
                 "LDR     R0, [R7,#0x20]\n"
                 "MOV     R2, #0\n"
                 "ADD     R1, SP, #0x1C\n"
                 "BL      sub_FFC15EBC\n"
                 "LDR     R0, [SP,#0xC]\n"
                 "CMP     R0, #1\n"
                 "BNE     loc_FFC74D1C\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R0, [R0]\n"
                 "CMP     R0, #0x13\n"
                 "CMPNE   R0, #0x14\n"
                 "CMPNE   R0, #0x15\n"
                 "CMPNE   R0, #0x16\n"
                 "BEQ     loc_FFC74E38\n"
                 "CMP     R0, #0x28\n"
                 "BEQ     loc_FFC74E10\n"
                 "ADD     R1, SP, #0xC\n"
                 "MOV     R0, #0\n"
                 "BL      sub_FFC74C60\n"
 "loc_FFC74D1C:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0]\n"
                 "CMP     R1, #0x2D\n"
                 "BNE     loc_FFC74D4C\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "BL      sub_FFC75F64\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R1, #1\n"
                 "BL      sub_FFC15C2C\n"
                 "BL      sub_FFC0BC54\n"
                 "ADD     SP, SP, #0x20\n"
                 "LDMFD   SP!, {R4-R8,PC}\n"
 "loc_FFC74D4C:\n"
                 "CMP     R1, #0x2C\n"
                 "BNE     loc_FFC74D68\n"
                 "LDR     R2, [R0,#0x88]!\n"
                 "LDR     R1, [R0,#4]\n"
                 "MOV     R0, R1\n"
                 "BLX     R2\n"
                 "B       loc_FFC75260\n"
 "loc_FFC74D68:\n"
                 "CMP     R1, #0x26\n"
                 "BNE     loc_FFC74DB8\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R1, #0x80\n"
                 "BL      sub_FFC15C60\n"
                 "LDR     R0, =0xFFC7163C\n"
                 "MOV     R1, #0x80\n"
                 "BL      sub_FFCE0CE4\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R2, R8\n"
                 "MOV     R1, #0x80\n"
                 "BL      sub_FFC15B6C\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0xDC6\n"
                 "BNE     loc_FFC74DFC\n"
 "loc_FFC74DA4:\n"
                 "LDR     R1, [SP,#0x1C]\n"
                 "LDR     R0, [R1,#0x8C]\n"
                 "LDR     R1, [R1,#0x88]\n"
                 "BLX     R1\n"
                 "B       loc_FFC75260\n"
 "loc_FFC74DB8:\n"
                 "CMP     R1, #0x27\n"
                 "BNE     loc_FFC74E08\n"
                 "ADD     R1, SP, #0xC\n"
                 "BL      sub_FFC74C60\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R1, #0x100\n"
                 "BL      sub_FFC15C60\n"
                 "LDR     R0, =0xFFC7164C\n"
                 "MOV     R1, #0x100\n"
                 "BL      sub_FFCE0F6C\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R2, R8\n"
                 "MOV     R1, #0x100\n"
                 "BL      sub_FFC15B6C\n"
                 "TST     R0, #1\n"
                 "BEQ     loc_FFC74DA4\n"
                 "MOV     R1, #0xDD0\n"
 "loc_FFC74DFC:\n"
                 "LDR     R0, =0xFFC71C7C\n"
                 "BL      sub_FFC0BE9C\n"
                 "B       loc_FFC74DA4\n"
 "loc_FFC74E08:\n"
                 "CMP     R1, #0x28\n"
                 "BNE     loc_FFC74E20\n"
 "loc_FFC74E10:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "ADD     R1, SP, #0xC\n"
                 "BL      sub_FFC74C60\n"
                 "B       loc_FFC74DA4\n"
 "loc_FFC74E20:\n"
                 "CMP     R1, #0x2B\n"
                 "BNE     loc_FFC74E38\n"
                 "BL      sub_FFC64ED4\n"
                 "BL      sub_FFC65B60\n"
                 "BL      sub_FFC65698\n"
                 "B       loc_FFC74DA4\n"
 "loc_FFC74E38:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "MOV     R4, #1\n"
                 "LDR     R1, [R0]\n"
                 "CMP     R1, #0x11\n"
                 "CMPNE   R1, #0x12\n"
                 "BNE     loc_FFC74EA8\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "ADD     R1, R1, R1,LSL#1\n"
                 "ADD     R1, R0, R1,LSL#2\n"
                 "SUB     R1, R1, #8\n"
                 "LDMIA   R1, {R2-R4}\n"
                 "STMIA   R6, {R2-R4}\n"
                 "BL      sub_FFC73714\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R3, [R0,#0x88]\n"
                 "LDR     R2, [R0,#0x8C]\n"
                 "ADD     R0, R0, #4\n"
                 "BLX     R3\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "BL      sub_FFC7631C\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R3, [R0,#0x90]\n"
                 "LDR     R2, [R0,#0x94]\n"
                 "ADD     R0, R0, #4\n"
                 "BLX     R3\n"
                 "B       loc_FFC751A0\n"
 "loc_FFC74EA8:\n"
                 "CMP     R1, #0x13\n"
                 "CMPNE   R1, #0x14\n"
                 "CMPNE   R1, #0x15\n"
                 "CMPNE   R1, #0x16\n"
                 "BNE     loc_FFC74F60\n"
                 "ADD     R3, SP, #0xC\n"
                 "MOV     R2, SP\n"
                 "ADD     R1, SP, #0x10\n"
                 "BL      sub_FFC73958\n"
                 "CMP     R0, #1\n"
                 "MOV     R4, R0\n"
                 "CMPNE   R4, #5\n"
                 "BNE     loc_FFC74EFC\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "MOV     R2, R4\n"
                 "LDR     R1, [R0,#0x7C]!\n"
                 "LDR     R12, [R0,#0xC]!\n"
                 "LDR     R3, [R0,#4]\n"
                 "MOV     R0, SP\n"
                 "BLX     R12\n"
                 "B       loc_FFC74F34\n"
 "loc_FFC74EFC:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "CMP     R4, #2\n"
                 "LDR     R3, [R0,#0x8C]\n"
                 "CMPNE   R4, #6\n"
                 "BNE     loc_FFC74F48\n"
                 "LDR     R12, [R0,#0x88]\n"
                 "MOV     R0, SP\n"
                 "MOV     R2, R4\n"
                 "MOV     R1, #1\n"
                 "BLX     R12\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "MOV     R2, SP\n"
                 "ADD     R1, SP, #0x10\n"
                 "BL      sub_FFC74980\n"
 "loc_FFC74F34:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R2, [SP,#0xC]\n"
                 "MOV     R1, R4\n"
                 "BL      sub_FFC74C00\n"
                 "B       loc_FFC751A0\n"
 "loc_FFC74F48:\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R12, [R0,#0x88]\n"
                 "ADD     R0, R0, #4\n"
                 "MOV     R2, R4\n"
                 "BLX     R12\n"
                 "B       loc_FFC751A0\n"
 "loc_FFC74F60:\n"
                 "CMP     R1, #0x22\n"
                 "CMPNE   R1, #0x23\n"
                 "BNE     loc_FFC74FAC\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "ADD     R1, R1, R1,LSL#1\n"
                 "ADD     R1, R0, R1,LSL#2\n"
                 "SUB     R1, R1, #8\n"
                 "LDMIA   R1, {R2-R4}\n"
                 "STMIA   R6, {R2-R4}\n"
                 "BL      sub_FFC72CA0\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R3, [R0,#0x88]\n"
                 "LDR     R2, [R0,#0x8C]\n"
                 "ADD     R0, R0, #4\n"
                 "BLX     R3\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "BL      sub_FFC72F90\n"
                 "B       loc_FFC751A0\n"
 "loc_FFC74FAC:\n"
                 "ADD     R1, R0, #4\n"
                 "LDMIA   R1, {R2,R3,R12}\n"
                 "STMIA   R6, {R2,R3,R12}\n"
                 "LDR     R1, [R0]\n"
                 "CMP     R1, #0x25\n"
                 "ADDLS   PC, PC, R1,LSL#2\n"
                 "B       loc_FFC75180\n"
 "loc_FFC74FC8:\n"
                 "B       loc_FFC75060\n"
 "loc_FFC74FCC:\n"
                 "B       loc_FFC75060\n"
 "loc_FFC74FD0:\n"
                 "B       loc_FFC75068\n"
 "loc_FFC74FD4:\n"
                 "B       loc_FFC75070\n"
 "loc_FFC74FD8:\n"
                 "B       loc_FFC75070\n"
 "loc_FFC74FDC:\n"
                 "B       loc_FFC75070\n"
 "loc_FFC74FE0:\n"
                 "B       loc_FFC75060\n"
 "loc_FFC74FE4:\n"
                 "B       loc_FFC75068\n"
 "loc_FFC74FE8:\n"
                 "B       loc_FFC75070\n"
 "loc_FFC74FEC:\n"
                 "B       loc_FFC75070\n"
 "loc_FFC74FF0:\n"
                 "B       loc_FFC75088\n"
 "loc_FFC74FF4:\n"
                 "B       loc_FFC75088\n"
 "loc_FFC74FF8:\n"
                 "B       loc_FFC75174\n"
 "loc_FFC74FFC:\n"
                 "B       loc_FFC7517C\n"
 "loc_FFC75000:\n"
                 "B       loc_FFC7517C\n"
 "loc_FFC75004:\n"
                 "B       loc_FFC7517C\n"
 "loc_FFC75008:\n"
                 "B       loc_FFC7517C\n"
 "loc_FFC7500C:\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75010:\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75014:\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75018:\n"
                 "B       loc_FFC75180\n"
 "loc_FFC7501C:\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75020:\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75024:\n"
                 "B       loc_FFC75078\n"
 "loc_FFC75028:\n"
                 "B       loc_FFC75080\n"
 "loc_FFC7502C:\n"
                 "B       loc_FFC75080\n"
 "loc_FFC75030:\n"
                 "B       loc_FFC75094\n"
 "loc_FFC75034:\n"
                 "B       loc_FFC75094\n"
 "loc_FFC75038:\n"
                 "B       loc_FFC7509C\n"
 "loc_FFC7503C:\n"
                 "B       loc_FFC750CC\n"
 "loc_FFC75040:\n"
                 "B       loc_FFC750FC\n"
 "loc_FFC75044:\n"
                 "B       loc_FFC7512C\n"
 "loc_FFC75048:\n"
                 "B       loc_FFC7515C\n"
 "loc_FFC7504C:\n"
                 "B       loc_FFC7515C\n"
 "loc_FFC75050:\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75054:\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75058:\n"
                 "B       loc_FFC75164\n"
 "loc_FFC7505C:\n"
                 "B       loc_FFC7516C\n"
 "loc_FFC75060:\n"
                 "BL      sub_FFC71B28\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75068:\n"
                 "BL      sub_FFC71D9C\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75070:\n"
                 "BL      sub_FFC71FA0\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75078:\n"
                 "BL      sub_FFC72208\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75080:\n"
                 "BL      sub_FFC723FC\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75088:\n"
                 "BL      sub_FFC7268C_my\n"  //---------->
                 "MOV     R4, #0\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75094:\n"
                 "BL      sub_FFC727C8\n"
                 "B       loc_FFC75180\n"
 "loc_FFC7509C:\n"
                 "LDRH    R1, [R0,#4]\n"
                 "STRH    R1, [SP,#0x10]\n"
                 "LDRH    R1, [R5,#2]\n"
                 "STRH    R1, [SP,#0x12]\n"
                 "LDRH    R1, [R5,#4]\n"
                 "STRH    R1, [SP,#0x14]\n"
                 "LDRH    R1, [R5,#6]\n"
                 "STRH    R1, [SP,#0x16]\n"
                 "LDRH    R1, [R0,#0xC]\n"
                 "STRH    R1, [SP,#0x18]\n"
                 "BL      sub_FFC75FD8\n"
                 "B       loc_FFC75180\n"
 "loc_FFC750CC:\n"
                 "LDRH    R1, [R0,#4]\n"
                 "STRH    R1, [SP,#0x10]\n"
                 "LDRH    R1, [R5,#2]\n"
                 "STRH    R1, [SP,#0x12]\n"
                 "LDRH    R1, [R5,#4]\n"
                 "STRH    R1, [SP,#0x14]\n"
                 "LDRH    R1, [R5,#6]\n"
                 "STRH    R1, [SP,#0x16]\n"
                 "LDRH    R1, [R5,#8]\n"
                 "STRH    R1, [SP,#0x18]\n"
                 "BL      sub_FFC76138\n"
                 "B       loc_FFC75180\n"
 "loc_FFC750FC:\n"
                 "LDRH    R1, [R5]\n"
                 "STRH    R1, [SP,#0x10]\n"
                 "LDRH    R1, [R0,#6]\n"
                 "STRH    R1, [SP,#0x12]\n"
                 "LDRH    R1, [R5,#4]\n"
                 "STRH    R1, [SP,#0x14]\n"
                 "LDRH    R1, [R5,#6]\n"
                 "STRH    R1, [SP,#0x16]\n"
                 "LDRH    R1, [R5,#8]\n"
                 "STRH    R1, [SP,#0x18]\n"
                 "BL      sub_FFC761E4\n"
                 "B       loc_FFC75180\n"
 "loc_FFC7512C:\n"
                 "LDRH    R1, [R5]\n"
                 "STRH    R1, [SP,#0x10]\n"
                 "LDRH    R1, [R5,#2]\n"
                 "STRH    R1, [SP,#0x12]\n"
                 "LDRH    R1, [R5,#4]\n"
                 "STRH    R1, [SP,#0x14]\n"
                 "LDRH    R1, [R5,#6]\n"
                 "STRH    R1, [SP,#0x16]\n"
                 "LDRH    R1, [R0,#0xC]\n"
                 "STRH    R1, [SP,#0x18]\n"
                 "BL      sub_FFC76284\n"
                 "B       loc_FFC75180\n"
 "loc_FFC7515C:\n"
                 "BL      sub_FFC72A68\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75164:\n"
                 "BL      sub_FFC73094\n"
                 "B       loc_FFC75180\n"
 "loc_FFC7516C:\n"
                 "BL      sub_FFC732CC\n"
                 "B       loc_FFC75180\n"
 "loc_FFC75174:\n"
                 "BL      sub_FFC73444\n"
                 "B       loc_FFC75180\n"
 "loc_FFC7517C:\n"
                 "BL      sub_FFC735DC\n"
 "loc_FFC75180:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "LDR     R3, [R0,#0x88]\n"
                 "LDR     R2, [R0,#0x8C]\n"
                 "ADD     R0, R0, #4\n"
                 "BLX     R3\n"
                 "CMP     R4, #1\n"
                 "BNE     loc_FFC751E8\n"
 "loc_FFC751A0:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "MOV     R2, #0xC\n"
                 "LDR     R1, [R0,#0x7C]\n"
                 "ADD     R1, R1, R1,LSL#1\n"
                 "ADD     R0, R0, R1,LSL#2\n"
                 "SUB     R4, R0, #8\n"
                 "LDR     R0, =0x17550\n"
                 "ADD     R1, SP, #0x10\n"
                 "BL      sub_FFE3138C\n"
                 "LDR     R0, =0x1755C\n"
                 "MOV     R2, #0xC\n"
                 "ADD     R1, SP, #0x10\n"
                 "BL      sub_FFE3138C\n"
                 "LDR     R0, =0x17568\n"
                 "MOV     R2, #0xC\n"
                 "MOV     R1, R4\n"
                 "BL      sub_FFE3138C\n"
                 "B       loc_FFC75260\n"
 "loc_FFC751E8:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "LDR     R0, [R0]\n"
                 "CMP     R0, #0xB\n"
                 "BNE     loc_FFC75230\n"
                 "MOV     R3, #0\n"
                 "STR     R3, [SP]\n"
                 "MOV     R3, #1\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #0\n"
                 "BL      sub_FFC71930\n"
                 "MOV     R3, #0\n"
                 "STR     R3, [SP]\n"
                 "MOV     R3, #1\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #0\n"
                 "B       loc_FFC7525C\n"
 "loc_FFC75230:\n"
                 "MOV     R3, #1\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #1\n"
                 "STR     R3, [SP]\n"
                 "BL      sub_FFC71930\n"
                 "MOV     R3, #1\n"
                 "MOV     R2, #1\n"
                 "MOV     R1, #1\n"
                 "MOV     R0, #1\n"
                 "STR     R3, [SP]\n"
 "loc_FFC7525C:\n"
                 "BL      sub_FFC71A70\n"
 "loc_FFC75260:\n"
                 "LDR     R0, [SP,#0x1C]\n"
                 "BL      sub_FFC75F64\n"
                 "B       loc_FFC74CD0\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC7268C_my(){ // 
 asm volatile(
/*                 "STMFD   SP!, {R4-R8,LR}\n"
                 "LDR     R7, =0x6EE4\n"
                 "MOV     R4, R0\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R1, #0x3E\n"
                 "BL      sub_FF871438\n"
                 "LDRSH   R0, [R4,#4]\n"
                 "MOV     R2, #0\n"
                 "MOV     R1, #0\n"
                 "BL      sub_FF8AA288\n"
                 "MOV     R6, R0\n"
                 "LDRSH   R0, [R4,#6]\n"
                 "BL      sub_FF8AA3A0\n"
                 "LDRSH   R0, [R4,#8]\n"
                 "BL      sub_FF8AA3F8\n"
                 "LDRSH   R0, [R4,#0xA]\n"
                 "BL      sub_FF8AA450\n"
                 "LDRSH   R0, [R4,#0xC]\n"
                 "BL      sub_FF8AA4A8\n"
                 "MOV     R5, R0\n"
                 "LDR     R0, [R4]\n"
                 "LDR     R8, =0x21108\n"
                 "CMP     R0, #0xB\n"
                 "MOVEQ   R6, #0\n"
                 "MOVEQ   R5, #0\n"
                 "BEQ     loc_FF8AB2D8\n"
                 "CMP     R6, #1\n"
                 "BNE     loc_FF8AB2D8\n"
                 "LDRSH   R0, [R4,#4]\n"
                 "LDR     R1, =0xFF8AA1F4\n"
                 "MOV     R2, #2\n"
                 "BL      sub_FF93B3A0\n"
                 "STRH    R0, [R4,#4]\n"
                 "MOV     R0, #0\n"
                 "STR     R0, [R7,#0x28]\n"
                 "B       loc_FF8AB2E0\n"
 "loc_FF8AB2D8:\n"
                 "LDRH    R0, [R8]\n"
                 "STRH    R0, [R4,#4]\n"
 "loc_FF8AB2E0:\n"
                 "CMP     R5, #1\n"
                 "LDRNEH  R0, [R8,#8]\n"
                 "BNE     loc_FF8AB2FC\n"
                 "LDRSH   R0, [R4,#0xC]\n"
                 "LDR     R1, =0xFF8AA278\n"
                 "MOV     R2, #0x20\n"
                 "BL      sub_FF8AEA4C\n"
 "loc_FF8AB2FC:\n"
                 "STRH    R0, [R4,#0xC]\n"
                 "LDRSH   R0, [R4,#6]\n"
                 "BL      sub_FF89D0AC_my\n"   //------------>
                 "LDRSH   R0, [R4,#8]\n"
                 "MOV     R1, #1\n"
                 "BL      sub_FF89D7F8\n"
                 "MOV     R1, #0\n"
                 "ADD     R0, R4, #8\n"
                 "BL      sub_FF89D880\n"
                 "LDRSH   R0, [R4,#0xE]\n"
                 "BL      sub_FF8A5F14\n"
                 "LDR     R4, =0xBB8\n"
                 "CMP     R6, #1\n"
                 "BNE     loc_FF8AB354\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R2, R4\n"
                 "MOV     R1, #2\n"
                 "BL      sub_FF871344\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0x54D\n"
                 "LDRNE   R0, =0xFF8AA90C\n"
                 "BLNE    sub_FF81B1CC\n"
 "loc_FF8AB354:\n"
                 "CMP     R5, #1\n"
                 "LDMNEFD SP!, {R4-R8,PC}\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R2, R4\n"
                 "MOV     R1, #0x20\n"
                 "BL      sub_FF871344\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0x552\n"
                 "LDRNE   R0, =0xFF8AA90C\n"
                 "LDMNEFD SP!, {R4-R8,LR}\n"
                 "BNE     sub_FF81B1CC\n"
                 "LDMFD   SP!, {R4-R8,PC}\n"*/

                 "STMFD   SP!, {R4-R8,LR}\n"
                 "LDR     R7, =0x36EC\n"
                 "MOV     R4, R0\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R1, #0x3E\n"
                 "BL      sub_FFC15C60\n"
                 "LDRSH   R0, [R4,#4]\n"
                 "MOV     R2, #0\n"
                 "MOV     R1, #0\n"
                 "BL      sub_FFC716C0\n"
                 "MOV     R6, R0\n"
                 "LDRSH   R0, [R4,#6]\n"
                 "BL      sub_FFC717D0\n"
                 "LDRSH   R0, [R4,#8]\n"
                 "BL      sub_FFC71828\n"
                 "LDRSH   R0, [R4,#0xA]\n"
                 "BL      sub_FFC71880\n"
                 "LDRSH   R0, [R4,#0xC]\n"
                 "BL      sub_FFC718D8\n"
                 "MOV     R5, R0\n"
                 "LDR     R0, [R4]\n"
                 "LDR     R8, =0x17568\n"
                 "CMP     R0, #0xB\n"
                 "MOVEQ   R6, #0\n"
                 "MOVEQ   R5, #0\n"
                 "BEQ     loc_FFC7271C\n"
                 "CMP     R6, #1\n"
                 "BNE     loc_FFC7271C\n"
                 "LDRSH   R0, [R4,#4]\n"
                 "LDR     R1, =0xFFC7162C\n"
                 "MOV     R2, #2\n"
                 "BL      sub_FFCE0E38\n"
                 "STRH    R0, [R4,#4]\n"
                 "MOV     R0, #0\n"
                 "STR     R0, [R7,#0x28]\n"
                 "B       loc_FFC72724\n"
 "loc_FFC7271C:\n"
                 "LDRH    R0, [R8]\n"
                 "STRH    R0, [R4,#4]\n"
 "loc_FFC72724:\n"
                 "CMP     R5, #1\n"
                 "LDRNEH  R0, [R8,#8]\n"
                 "BNE     loc_FFC72740\n"
                 "LDRSH   R0, [R4,#0xC]\n"
                 "LDR     R1, =0xFFC716B0\n"
                 "MOV     R2, #0x20\n"
                 "BL      sub_FFC75F94\n"
 "loc_FFC72740:\n"
                 "STRH    R0, [R4,#0xC]\n"
                 "LDRSH   R0, [R4,#6]\n"
                 "BL      sub_FFC64C44_my\n"  //----------->
                 "LDRSH   R0, [R4,#8]\n"
                 "MOV     R1, #1\n"
                 "BL      sub_FFC65390\n"
                 "MOV     R1, #0\n"
                 "ADD     R0, R4, #8\n"
                 "BL      sub_FFC65418\n"
                 "LDRSH   R0, [R4,#0xE]\n"
                 "BL      sub_FFC6D144\n"
                 "LDR     R4, =0xBB8\n"
                 "CMP     R6, #1\n"
                 "BNE     loc_FFC72798\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R2, R4\n"
                 "MOV     R1, #2\n"
                 "BL      sub_FFC15B6C\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0x583\n"
                 "LDRNE   R0, =0xFFC71C7C\n"
                 "BLNE    sub_FFC0BE9C\n"
 "loc_FFC72798:\n"
                 "CMP     R5, #1\n"
                 "LDMNEFD SP!, {R4-R8,PC}\n"
                 "LDR     R0, [R7,#0x1C]\n"
                 "MOV     R2, R4\n"
                 "MOV     R1, #0x20\n"
                 "BL      sub_FFC15B6C\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0x588\n"
                 "LDRNE   R0, =0xFFC71C7C\n"
                 "LDMNEFD SP!, {R4-R8,LR}\n"
                 "BNE     sub_FFC0BE9C\n"
                 "LDMFD   SP!, {R4-R8,PC}\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC64C44_my(){ // 
 asm volatile(
/*                 "STMFD   SP!, {R4-R6,LR}\n"
                 "LDR     R5, =0x6C14\n"
                 "MOV     R4, R0\n"
                 "LDR     R0, [R5,#4]\n"
                 "CMP     R0, #1\n"
                 "MOVNE   R1, #0x140\n"
                 "LDRNE   R0, =0xFF89CEB0\n"
                 "BLNE    sub_FF81B1CC\n"
                 "CMN     R4, #0xC00\n"
                 "LDREQSH R4, [R5,#2]\n"
                 "CMN     R4, #0xC00\n"
                 "LDREQ   R1, =0x146\n"
                 "LDREQ   R0, =0xFF89CEB0\n"
                 "STRH    R4, [R5,#2]\n"
                 "BLEQ    sub_FF81B1CC\n"
                 "MOV     R0, R4\n"
           //    "BL      sub_FF9E0128\n"  // -
                 "BL      apex2us\n"  // +
                 "MOV     R4, R0\n"
           //    "BL      nullsub_228\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FF8D6280\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0x14B\n"
                 "LDMNEFD SP!, {R4-R6,LR}\n"
                 "LDRNE   R0, =0xFF89CEB0\n"
                 "BNE     sub_FF81B1CC\n"
                 "LDMFD   SP!, {R4-R6,PC}\n"*/

                 "STMFD   SP!, {R4-R6,LR}\n"
                 "LDR     R5, =0x3404\n"
                 "MOV     R4, R0\n"
                 "LDR     R0, [R5,#4]\n"
                 "CMP     R0, #1\n"
                 "MOVNE   R1, #0x140\n"
                 "LDRNE   R0, =0xFFC64A48\n"
                 "BLNE    sub_FFC0BE9C\n"
                 "CMN     R4, #0xC00\n"
                 "LDREQSH R4, [R5,#2]\n"
                 "CMN     R4, #0xC00\n"
                 "LDREQ   R1, =0x146\n"
                 "LDREQ   R0, =0xFFC64A48\n"
                 "STRH    R4, [R5,#2]\n"
                 "BLEQ    sub_FFC0BE9C\n"
                 "MOV     R0, R4\n"
             //  "BL      sub_FFD4CF08\n"        // -
                 "BL      apex2us\n"             // +
                 "MOV     R4, R0\n"
             //  "BL      nullsub_203\n"
                 "MOV     R0, R4\n"
                 "BL      sub_FFC8BA78\n"
                 "TST     R0, #1\n"
                 "LDRNE   R1, =0x14B\n"
                 "LDMNEFD SP!, {R4-R6,LR}\n"
                 "LDRNE   R0, =0xFFC64A48\n"
                 "BNE     sub_FFC0BE9C\n"
                 "LDMFD   SP!, {R4-R6,PC}\n"
 );
}
